package com.netease.pris.activity;

import android.text.TextUtils;
import android.widget.Toast;
import com.netease.framework.j;
import com.netease.pris.a.i;
import com.netease.pris.activity.view.TouchInterceptor;
import com.netease.pris.app.PrisApp;
import com.netease.pris.atom.PRISNotification;
import com.netease.pris.atom.PRISNotification.PrisMessage;
import com.netease.pris.atom.ad;
import com.netease.pris.atom.o;
import com.netease.pris.atom.q;
import com.netease.pris.atom.r;
import com.netease.pris.atom.u;
import com.netease.pris.b;
import com.netease.pris.b.a;
import com.netease.pris.c.h;
import com.netease.pris.v;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

class ak extends b
{
  ak(MainGridActivity paramMainGridActivity)
  {
  }

  public void a()
  {
    MainGridActivity.r(this.a);
    dc.a(j.a().c(), 403);
    if (MainGridActivity.s(this.a) != null)
      MainGridActivity.s(this.a).a(true);
  }

  public void a(int paramInt)
  {
    if (MainGridActivity.u(this.a).remove(new Integer(paramInt)))
      MainGridActivity.v(this.a);
  }

  public void a(int paramInt1, int paramInt2)
  {
    MainGridActivity.d(this.a, 0);
  }

  public void a(int paramInt1, int paramInt2, String paramString, boolean paramBoolean)
  {
    MainGridActivity.t(this.a).b(paramInt1);
  }

  public void a(int paramInt, com.netease.pris.protocol.d paramd, boolean paramBoolean)
  {
    MainGridActivity.t(this.a).b(paramInt);
  }

  public void b()
  {
    h.a(MainGridActivity.p(this.a), com.netease.b.a.d.h().c(), false);
  }

  public void b(int paramInt1, int paramInt2, String paramString)
  {
    MainGridActivity.u(this.a).remove(new Integer(paramInt1));
  }

  public void b(int paramInt, com.netease.pris.protocol.d paramd)
  {
    if (paramd == null)
      if (MainGridActivity.u(this.a).contains(new Integer(paramInt)))
        MainGridActivity.u(this.a).remove(new Integer(paramInt));
    label258: 
    while (true)
    {
      return;
      if (paramd.j.size() > 0)
        if (MainGridActivity.u(this.a).contains(new Integer(paramInt)))
        {
          MainGridActivity.u(this.a).remove(new Integer(paramInt));
          Toast.makeText(MainGridActivity.p(this.a), 2131361911, 0).show();
        }
      while (true)
      {
        if (paramd.j.size() <= 0)
          break label258;
        u localu = new u();
        localu.q(((o)paramd.j.getFirst()).a());
        MainGridActivity.c(this.a).remove(localu);
        this.a.z = true;
        MainGridActivity.a(this.a, null);
        break;
        if ((paramd.i.size() <= 0) || (!MainGridActivity.u(this.a).contains(new Integer(paramInt))))
          continue;
        MainGridActivity.u(this.a).remove(new Integer(paramInt));
        Toast.makeText(MainGridActivity.p(this.a), ((r)paramd.i.getFirst()).e(), 0).show();
      }
    }
  }

  public void c(int paramInt1, int paramInt2, String paramString)
  {
    if (MainGridActivity.u(this.a).contains(new Integer(paramInt1)))
      MainGridActivity.u(this.a).remove(new Integer(paramInt1));
    MainGridActivity.r(this.a);
    u localu = new u();
    localu.q("-1");
    if (!MainGridActivity.c(this.a).contains(localu))
      MainGridActivity.c(this.a).add(localu);
    this.a.z = true;
    MainGridActivity.a(this.a, null);
    dc.a(MainGridActivity.p(this.a), paramInt2);
    if (MainGridActivity.s(this.a) != null)
      MainGridActivity.s(this.a).a(true);
  }

  public void c(int paramInt, com.netease.pris.protocol.d paramd)
  {
    PRISNotification localPRISNotification;
    if ((MainGridActivity.u(this.a).remove(new Integer(paramInt))) && (paramd.g != null))
    {
      localPRISNotification = paramd.g.u();
      if (localPRISNotification != null);
    }
    else
    {
      return;
      break label143;
    }
    while (true)
    {
      Date localDate1 = localPRISNotification.c();
      if (localDate1 == null)
        continue;
      String str = a.k();
      int i = 1;
      q localq = new q();
      localq.g(str);
      if ((!TextUtils.isEmpty(str)) && (localq.a() != null) && (localq.a().compareTo(localDate1) >= 0))
        i = 0;
      if (i == 0)
        continue;
      List localList = localPRISNotification.b();
      if ((localList == null) || (localList.size() <= 0))
        continue;
      Iterator localIterator = localList.iterator();
      label143: if (!localIterator.hasNext())
        continue;
      PRISNotification.PrisMessage localPrisMessage = (PRISNotification.PrisMessage)localIterator.next();
      Date localDate2 = localPrisMessage.f();
      if ((localDate2 == null) || ((localq.a() != null) && (!localDate2.after(localq.a()))))
        break;
      com.netease.l.b.d.a(localPrisMessage);
      a.e(localPrisMessage.g());
    }
  }

  public void d(int paramInt1, int paramInt2, String paramString)
  {
    if (MainGridActivity.u(this.a).contains(new Integer(paramInt1)))
    {
      MainGridActivity.u(this.a).remove(new Integer(paramInt1));
      dc.a(MainGridActivity.p(this.a), paramInt2);
    }
  }

  public void d(int paramInt, com.netease.pris.protocol.d paramd)
  {
    LinkedList localLinkedList = paramd.h;
    this.a.z = true;
    MainGridActivity.a(this.a, localLinkedList);
  }

  public void e(int paramInt1, int paramInt2, String paramString)
  {
    if (MainGridActivity.u(this.a).contains(new Integer(paramInt1)))
    {
      MainGridActivity.u(this.a).remove(new Integer(paramInt1));
      dc.a(MainGridActivity.p(this.a), paramInt2);
    }
  }

  public void e(int paramInt, com.netease.pris.protocol.d paramd)
  {
    if (((paramd == null) || (paramd.d())) && (MainGridActivity.u(this.a).contains(new Integer(paramInt))))
      MainGridActivity.u(this.a).remove(new Integer(paramInt));
    if (paramd == null)
      return;
    MainGridActivity.t(this.a).a(MainGridActivity.w(this.a) / 2, MainGridActivity.x(this.a));
    if (!paramd.e())
    {
      long l = System.currentTimeMillis();
      h.a(this.a, com.netease.b.a.d.h().c(), l);
      h.a(this.a, com.netease.b.a.d.h().c());
    }
    if (paramd.e())
    {
      MainGridActivity.a(this.a, paramd);
      if (paramd.d())
        MainGridActivity.v(this.a);
    }
    while (true)
    {
      PrisApp.a().a(MainGridActivity.c(this.a));
      break;
      if (paramd.g())
      {
        MainGridActivity.a(this.a, paramd);
        if (!paramd.d())
          continue;
        MainGridActivity.a(this.a, 313, paramd.h, null, null);
        continue;
      }
      if (paramd.f())
      {
        if (paramd.i())
          MainGridActivity.a(this.a, paramd);
        while (true)
        {
          if ((paramd.j()) || (!paramd.d()))
            break label288;
          MainGridActivity.a(this.a, 313, paramd.h, null, null);
          v.a().l();
          break;
          this.a.z = true;
          MainGridActivity.a(this.a, null);
        }
        label288: continue;
      }
      if (!paramd.d())
        continue;
      this.a.z = true;
      MainGridActivity.a(this.a, null);
      if ((paramd.j()) || (!paramd.d()))
        continue;
      MainGridActivity.a(this.a, 313, paramd.h, null, null);
    }
  }

  public void f(int paramInt1, int paramInt2, String paramString)
  {
    if (MainGridActivity.u(this.a).contains(new Integer(paramInt1)))
    {
      MainGridActivity.u(this.a).remove(new Integer(paramInt1));
      MainGridActivity.r(this.a);
      u localu = new u();
      localu.q("-1");
      if (!MainGridActivity.c(this.a).contains(localu))
      {
        MainGridActivity.c(this.a).add(localu);
        this.a.z = true;
        MainGridActivity.a(this.a, null);
      }
      dc.a(MainGridActivity.p(this.a), paramInt2);
      if (MainGridActivity.s(this.a) != null)
        MainGridActivity.s(this.a).a(true);
    }
  }

  public void f(int paramInt, com.netease.pris.protocol.d paramd)
  {
    if (MainGridActivity.u(this.a).contains(new Integer(paramInt)))
      MainGridActivity.u(this.a).remove(new Integer(paramInt));
    if (paramd == null);
    while (true)
    {
      return;
      if (paramd.h.size() > 0)
      {
        Iterator localIterator = paramd.h.iterator();
        i = 0;
        while (localIterator.hasNext())
        {
          u localu = (u)localIterator.next();
          if (MainGridActivity.c(this.a).contains(localu))
            continue;
          MainGridActivity.c(this.a).add(-1 + MainGridActivity.c(this.a).size(), localu);
          i++;
        }
      }
      int i = 0;
      if (i <= 0)
        continue;
      this.a.z = true;
      MainGridActivity.a(this.a, null);
      if ((!com.netease.b.a.d.h().i()) || (!i.a(a.p(), 10, 10)))
        continue;
      com.netease.l.b.d.a(MainGridActivity.p(this.a), 256);
    }
  }

  public void g(int paramInt, com.netease.pris.protocol.d paramd)
  {
    if (paramd == null)
    {
      if (MainGridActivity.u(this.a).contains(new Integer(paramInt)))
        MainGridActivity.u(this.a).remove(new Integer(paramInt));
      return;
    }
    if (MainGridActivity.u(this.a).contains(new Integer(paramInt)))
    {
      MainGridActivity.u(this.a).remove(new Integer(paramInt));
      long l = System.currentTimeMillis();
      h.a(this.a, com.netease.b.a.d.h().c(), l);
      h.a(this.a, com.netease.b.a.d.h().c());
      MainGridActivity.a(this.a, 313, paramd.h, null, null);
      if (MainGridActivity.y(this.a) != 0)
        break label195;
      MainGridActivity.a(this.a, paramd);
      if (i.a(a.p(), 10, 10))
        com.netease.l.b.d.a(MainGridActivity.p(this.a), 256);
    }
    while (true)
    {
      PrisApp.a().a(MainGridActivity.c(this.a));
      break;
      break;
      label195: if (1 != MainGridActivity.y(this.a))
        continue;
      MainGridActivity.a(this.a, paramd);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.ak
 * JD-Core Version:    0.6.0
 */